package com.yaowk.system.server.entity;

import com.yaowk.common.db.BaseEntity;
import com.yaowk.common.db.GeneratorNote;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.annotations.CreationTimestamp;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import java.util.Date;

@Getter
@Setter
@ToString
@Entity
public class SysLogin extends BaseEntity<Long> {

    @CreationTimestamp
    @GeneratorNote("登录时间")
    private Date createTime;
    @GeneratorNote("登录ip")
    private String ip;
    @GeneratorNote("用户id")
    @Column(insertable = false, updatable = false)
    private Long userId;

    @ManyToOne
    @JoinColumn(name = "userId")
    private SysUser user;
}
